<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>
<body>
	<h:form id="test">



		<p:dataTable var="e" value="#{roleAccessBean.tempRoleViews}"
			stickyHeader="true" style="width:100%;text-align: center;">
			<p:column headerText="user" width="8%">
				<h:outputText value="#{e.user.username}" />
			</p:column>

			<p:column headerText="FullName">
				<h:outputText value="#{e.user.firstName} #{e.user.lastName}" />
			</p:column>

			<p:column style="width:10%" headerText="Actions">
				<p:commandButton id="selectButton" icon="ui-icon-wrench"
					update=":test:display" oncomplete="PF('Dialog').show()"
					title="Edit">
					<f:setPropertyActionListener value="#{e}"
						target="#{roleAccessBean.selectedTempRoleView}" />
				</p:commandButton>

			</p:column>
		</p:dataTable>


		<p:dialog header="Detail" widgetVar="Dialog" resizable="false"
			width="40%" id="carDlg" showEffect="fade" hideEffect="explode"
			modal="true">

			<h:panelGrid id="display" columns="2" cellpadding="4"
				style="margin:0 1px;">
				<h:outputText value="FullName:" />
				<h:outputText
					value="#{roleAccessBean.selectedTempRoleView.user.firstName}  #{roleAccessBean.selectedTempRoleView.user.lastName}"
					style="font-weight:bold" />

				<h:outputText value="choose role:" />
				<p:selectManyCheckbox id="roleshow"
					value="#{testSelectBean.roleList}" layout="grid" columns="3">
					<f:selectItems value="#{testSelectBean.allRoles}" />
				</p:selectManyCheckbox>


			</h:panelGrid>

			<!-- use link -->
			<p:commandLink id="save" style="float:right;"
				oncomplete="Dialog.hide()" action="#{testSelectBean.doUpdate()}"
				styleClass="btn_saveRole">
			</p:commandLink>
		</p:dialog>







		<p:selectManyCheckbox id="roleshowx"
			value="#{testSelectBean.roleList}" layout="grid" columns="3">
			<f:selectItems value="#{testSelectBean.allRoles}" />
		</p:selectManyCheckbox>
		<p:commandButton id="savex" value="save"
			action="#{testSelectBean.doUpdate()}" update="test">
		</p:commandButton>
	</h:form>
</body>
</html>
